class Car(val licensePlate: String, val brand: String, val color: String, var price: Double) {
  def drive(mileage: Double): Unit = {
    println(s"Driving $mileage miles.")
  }

  def park(): Unit = {
    println("Parking the car.")
  }

  def refuel(): Unit = {
    println("Refueling the car.")
  }
}

class ElectricCar(licensePlate: String, brand: String, color: String, price: Double, val batteryCapacity: Double, var estimatedMileage: Double) extends Car(licensePlate, brand, color, price) {
  def recharge(): Unit = {
    println("Recharging the car battery.")
  }

  override def drive(mileage: Double): Unit = {
    if (estimatedMileage >= mileage) {
      estimatedMileage -= mileage
      println(s"Driving $mileage miles.")
    } else {
      println("Insufficient battery charge.")
    }
  }
}